using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using System.Xml.Serialization;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace Kinlo.Entitys
{
    /// <summary>生产数据</summary>
    [Serializable]
    [DataObject]
    [Description("生产数据")]
    [BindTable("ProductionData", Description = "生产数据", ConnName = "MySql", DbType = DatabaseType.None)]
    public partial class ProductionData
    {
        #region 属性
        private Int64 _SnowflakeId;
        /// <summary>雪花ID</summary>
        [DisplayName("雪花ID")]
        [Description("雪花ID")]
        [DataObjectField(true, false, false, 0)]
        [BindColumn("SnowflakeId", "雪花ID", "")]
        public Int64 SnowflakeId { get => _SnowflakeId; set { if (OnPropertyChanging("SnowflakeId", value)) { _SnowflakeId = value; OnPropertyChanged("SnowflakeId"); } } }

        private String _BarCode;
        /// <summary>电池条码</summary>
        [DisplayName("电池条码")]
        [Description("电池条码")]
        [DataObjectField(false, false, false, 64)]
        [BindColumn("BarCode", "电池条码", "", Master = true)]
        public String BarCode { get => _BarCode; set { if (OnPropertyChanging("BarCode", value)) { _BarCode = value; OnPropertyChanged("BarCode"); } } }

        private String _EquipNum;
        /// <summary>设备编号</summary>
        [DisplayName("设备编号")]
        [Description("设备编号")]
        [DataObjectField(false, false, true, 64)]
        [BindColumn("EquipNum", "设备编号", "")]
        public String EquipNum { get => _EquipNum; set { if (OnPropertyChanging("EquipNum", value)) { _EquipNum = value; OnPropertyChanged("EquipNum"); } } }

        private String _TechnicsProcessCode;
        /// <summary>工序编号</summary>
        [DisplayName("工序编号")]
        [Description("工序编号")]
        [DataObjectField(false, false, true, 32)]
        [BindColumn("TechnicsProcessCode", "工序编号", "")]
        public String TechnicsProcessCode { get => _TechnicsProcessCode; set { if (OnPropertyChanging("TechnicsProcessCode", value)) { _TechnicsProcessCode = value; OnPropertyChanged("TechnicsProcessCode"); } } }

        private String _WorkOrderNumber;
        /// <summary>工单号</summary>
        [DisplayName("工单号")]
        [Description("工单号")]
        [DataObjectField(false, false, true, 128)]
        [BindColumn("WorkOrderNumber", "工单号", "")]
        public String WorkOrderNumber { get => _WorkOrderNumber; set { if (OnPropertyChanging("WorkOrderNumber", value)) { _WorkOrderNumber = value; OnPropertyChanged("WorkOrderNumber"); } } }

        private String _ProductionLineNo;
        /// <summary>产线编号</summary>
        [DisplayName("产线编号")]
        [Description("产线编号")]
        [DataObjectField(false, false, true, 32)]
        [BindColumn("ProductionLineNo", "产线编号", "")]
        public String ProductionLineNo { get => _ProductionLineNo; set { if (OnPropertyChanging("ProductionLineNo", value)) { _ProductionLineNo = value; OnPropertyChanged("ProductionLineNo"); } } }

        private String _ProductType;
        /// <summary>生产类型</summary>
        [DisplayName("生产类型")]
        [Description("生产类型")]
        [DataObjectField(false, false, true, 32)]
        [BindColumn("ProductType", "生产类型", "")]
        public String ProductType { get => _ProductType; set { if (OnPropertyChanging("ProductType", value)) { _ProductType = value; OnPropertyChanged("ProductType"); } } }

        private Int64 _TimeScanCodeBefore;
        /// <summary>前扫码时间</summary>
        [DisplayName("前扫码时间")]
        [Description("前扫码时间")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("TimeScanCodeBefore", "前扫码时间", "")]
        public Int64 TimeScanCodeBefore { get => _TimeScanCodeBefore; set { if (OnPropertyChanging("TimeScanCodeBefore", value)) { _TimeScanCodeBefore = value; OnPropertyChanged("TimeScanCodeBefore"); } } }

        private Int64 _TimeElectrodes;
        /// <summary>短路测试时间</summary>
        [DisplayName("短路测试时间")]
        [Description("短路测试时间")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("TimeElectrodes", "短路测试时间", "")]
        public Int64 TimeElectrodes { get => _TimeElectrodes; set { if (OnPropertyChanging("TimeElectrodes", value)) { _TimeElectrodes = value; OnPropertyChanged("TimeElectrodes"); } } }

        private Double _ElapsedTimeElectrodes;
        /// <summary>短路测试耗时时间</summary>
        [DisplayName("短路测试耗时时间")]
        [Description("短路测试耗时时间")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("ElapsedTimeElectrodes", "短路测试耗时时间", "")]
        public Double ElapsedTimeElectrodes { get => _ElapsedTimeElectrodes; set { if (OnPropertyChanging("ElapsedTimeElectrodes", value)) { _ElapsedTimeElectrodes = value; OnPropertyChanged("ElapsedTimeElectrodes"); } } }

        private Int64 _TimeAltimetry;
        /// <summary>测高时间</summary>
        [DisplayName("测高时间")]
        [Description("测高时间")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("TimeAltimetry", "测高时间", "")]
        public Int64 TimeAltimetry { get => _TimeAltimetry; set { if (OnPropertyChanging("TimeAltimetry", value)) { _TimeAltimetry = value; OnPropertyChanged("TimeAltimetry"); } } }

        private Int64 _TimeCCD;
        /// <summary>CDD测试时间</summary>
        [DisplayName("CDD测试时间")]
        [Description("CDD测试时间")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("TimeCCD", "CDD测试时间", "")]
        public Int64 TimeCCD { get => _TimeCCD; set { if (OnPropertyChanging("TimeCCD", value)) { _TimeCCD = value; OnPropertyChanged("TimeCCD"); } } }

        private Double _AltimetryValue;
        /// <summary>测高高度值</summary>
        [DisplayName("测高高度值")]
        [Description("测高高度值")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("AltimetryValue", "测高高度值", "")]
        public Double AltimetryValue { get => _AltimetryValue; set { if (OnPropertyChanging("AltimetryValue", value)) { _AltimetryValue = value; OnPropertyChanged("AltimetryValue"); } } }

        private Byte _LocationScanCodeBefore;
        /// <summary>前扫码位置</summary>
        [DisplayName("前扫码位置")]
        [Description("前扫码位置")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("LocationScanCodeBefore", "前扫码位置", "")]
        public Byte LocationScanCodeBefore { get => _LocationScanCodeBefore; set { if (OnPropertyChanging("LocationScanCodeBefore", value)) { _LocationScanCodeBefore = value; OnPropertyChanged("LocationScanCodeBefore"); } } }

        private Byte _LocationShortCircuitTester;
        /// <summary>短路测试仪位置</summary>
        [DisplayName("短路测试仪位置")]
        [Description("短路测试仪位置")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("LocationShortCircuitTester", "短路测试仪位置", "")]
        public Byte LocationShortCircuitTester { get => _LocationShortCircuitTester; set { if (OnPropertyChanging("LocationShortCircuitTester", value)) { _LocationShortCircuitTester = value; OnPropertyChanged("LocationShortCircuitTester"); } } }

        private Double _VoltageTestValue;
        /// <summary>电压测试值(V)</summary>
        [DisplayName("电压测试值")]
        [Description("电压测试值(V)")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("VoltageTestValue", "电压测试值(V)", "")]
        public Double VoltageTestValue { get => _VoltageTestValue; set { if (OnPropertyChanging("VoltageTestValue", value)) { _VoltageTestValue = value; OnPropertyChanged("VoltageTestValue"); } } }

        private Double _ResistanceTestValue;
        /// <summary>电阻测试值(MΩ)</summary>
        [DisplayName("电阻测试值")]
        [Description("电阻测试值(MΩ)")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("ResistanceTestValue", "电阻测试值(MΩ)", "")]
        public Double ResistanceTestValue { get => _ResistanceTestValue; set { if (OnPropertyChanging("ResistanceTestValue", value)) { _ResistanceTestValue = value; OnPropertyChanged("ResistanceTestValue"); } } }

        private Double _CurrentTestValue;
        /// <summary>电流测试值(UA)</summary>
        [DisplayName("电流测试值")]
        [Description("电流测试值(UA)")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("CurrentTestValue", "电流测试值(UA)", "")]
        public Double CurrentTestValue { get => _CurrentTestValue; set { if (OnPropertyChanging("CurrentTestValue", value)) { _CurrentTestValue = value; OnPropertyChanged("CurrentTestValue"); } } }

        private XingLucifer.IBase.Enums.ResultTypes _ResultScanCodeBefore;
        /// <summary>前扫码结果</summary>
        [DisplayName("前扫码结果")]
        [Description("前扫码结果")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("ResultScanCodeBefore", "前扫码结果", "")]
        public XingLucifer.IBase.Enums.ResultTypes ResultScanCodeBefore { get => _ResultScanCodeBefore; set { if (OnPropertyChanging("ResultScanCodeBefore", value)) { _ResultScanCodeBefore = value; OnPropertyChanged("ResultScanCodeBefore"); } } }

        private XingLucifer.IBase.Enums.ResultTypes _ResultCCD1;
        /// <summary>CCD1结果</summary>
        [DisplayName("CCD1结果")]
        [Description("CCD1结果")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("ResultCCD1", "CCD1结果", "")]
        public XingLucifer.IBase.Enums.ResultTypes ResultCCD1 { get => _ResultCCD1; set { if (OnPropertyChanging("ResultCCD1", value)) { _ResultCCD1 = value; OnPropertyChanged("ResultCCD1"); } } }

        private XingLucifer.IBase.Enums.ResultTypes _ResultCCD2;
        /// <summary>CCD2结果</summary>
        [DisplayName("CCD2结果")]
        [Description("CCD2结果")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("ResultCCD2", "CCD2结果", "")]
        public XingLucifer.IBase.Enums.ResultTypes ResultCCD2 { get => _ResultCCD2; set { if (OnPropertyChanging("ResultCCD2", value)) { _ResultCCD2 = value; OnPropertyChanged("ResultCCD2"); } } }

        private XingLucifer.IBase.Enums.ResultTypes _AltimetryResult;
        /// <summary>测高结果</summary>
        [DisplayName("测高结果")]
        [Description("测高结果")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("AltimetryResult", "测高结果", "")]
        public XingLucifer.IBase.Enums.ResultTypes AltimetryResult { get => _AltimetryResult; set { if (OnPropertyChanging("AltimetryResult", value)) { _AltimetryResult = value; OnPropertyChanged("AltimetryResult"); } } }

        private XingLucifer.IBase.Enums.ResultTypes _ResultShortCicute;
        /// <summary>短路总结果</summary>
        [DisplayName("短路总结果")]
        [Description("短路总结果")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("ResultShortCicute", "短路总结果", "")]
        public XingLucifer.IBase.Enums.ResultTypes ResultShortCicute { get => _ResultShortCicute; set { if (OnPropertyChanging("ResultShortCicute", value)) { _ResultShortCicute = value; OnPropertyChanged("ResultShortCicute"); } } }

        private XingLucifer.IBase.Enums.ResultTypes _ResultTotal;
        /// <summary>总结果</summary>
        [DisplayName("总结果")]
        [Description("总结果")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("ResultTotal", "总结果", "")]
        public XingLucifer.IBase.Enums.ResultTypes ResultTotal { get => _ResultTotal; set { if (OnPropertyChanging("ResultTotal", value)) { _ResultTotal = value; OnPropertyChanged("ResultTotal"); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "SnowflakeId": return _SnowflakeId;
                    case "BarCode": return _BarCode;
                    case "EquipNum": return _EquipNum;
                    case "TechnicsProcessCode": return _TechnicsProcessCode;
                    case "WorkOrderNumber": return _WorkOrderNumber;
                    case "ProductionLineNo": return _ProductionLineNo;
                    case "ProductType": return _ProductType;
                    case "TimeScanCodeBefore": return _TimeScanCodeBefore;
                    case "TimeElectrodes": return _TimeElectrodes;
                    case "ElapsedTimeElectrodes": return _ElapsedTimeElectrodes;
                    case "TimeAltimetry": return _TimeAltimetry;
                    case "TimeCCD": return _TimeCCD;
                    case "AltimetryValue": return _AltimetryValue;
                    case "LocationScanCodeBefore": return _LocationScanCodeBefore;
                    case "LocationShortCircuitTester": return _LocationShortCircuitTester;
                    case "VoltageTestValue": return _VoltageTestValue;
                    case "ResistanceTestValue": return _ResistanceTestValue;
                    case "CurrentTestValue": return _CurrentTestValue;
                    case "ResultScanCodeBefore": return _ResultScanCodeBefore;
                    case "ResultCCD1": return _ResultCCD1;
                    case "ResultCCD2": return _ResultCCD2;
                    case "AltimetryResult": return _AltimetryResult;
                    case "ResultShortCicute": return _ResultShortCicute;
                    case "ResultTotal": return _ResultTotal;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "SnowflakeId": _SnowflakeId = value.ToLong(); break;
                    case "BarCode": _BarCode = Convert.ToString(value); break;
                    case "EquipNum": _EquipNum = Convert.ToString(value); break;
                    case "TechnicsProcessCode": _TechnicsProcessCode = Convert.ToString(value); break;
                    case "WorkOrderNumber": _WorkOrderNumber = Convert.ToString(value); break;
                    case "ProductionLineNo": _ProductionLineNo = Convert.ToString(value); break;
                    case "ProductType": _ProductType = Convert.ToString(value); break;
                    case "TimeScanCodeBefore": _TimeScanCodeBefore = value.ToLong(); break;
                    case "TimeElectrodes": _TimeElectrodes = value.ToLong(); break;
                    case "ElapsedTimeElectrodes": _ElapsedTimeElectrodes = value.ToDouble(); break;
                    case "TimeAltimetry": _TimeAltimetry = value.ToLong(); break;
                    case "TimeCCD": _TimeCCD = value.ToLong(); break;
                    case "AltimetryValue": _AltimetryValue = value.ToDouble(); break;
                    case "LocationScanCodeBefore": _LocationScanCodeBefore = Convert.ToByte(value); break;
                    case "LocationShortCircuitTester": _LocationShortCircuitTester = Convert.ToByte(value); break;
                    case "VoltageTestValue": _VoltageTestValue = value.ToDouble(); break;
                    case "ResistanceTestValue": _ResistanceTestValue = value.ToDouble(); break;
                    case "CurrentTestValue": _CurrentTestValue = value.ToDouble(); break;
                    case "ResultScanCodeBefore": _ResultScanCodeBefore = (XingLucifer.IBase.Enums.ResultTypes)value.ToInt(); break;
                    case "ResultCCD1": _ResultCCD1 = (XingLucifer.IBase.Enums.ResultTypes)value.ToInt(); break;
                    case "ResultCCD2": _ResultCCD2 = (XingLucifer.IBase.Enums.ResultTypes)value.ToInt(); break;
                    case "AltimetryResult": _AltimetryResult = (XingLucifer.IBase.Enums.ResultTypes)value.ToInt(); break;
                    case "ResultShortCicute": _ResultShortCicute = (XingLucifer.IBase.Enums.ResultTypes)value.ToInt(); break;
                    case "ResultTotal": _ResultTotal = (XingLucifer.IBase.Enums.ResultTypes)value.ToInt(); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得生产数据字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary>雪花ID</summary>
            public static readonly Field SnowflakeId = FindByName("SnowflakeId");

            /// <summary>电池条码</summary>
            public static readonly Field BarCode = FindByName("BarCode");

            /// <summary>设备编号</summary>
            public static readonly Field EquipNum = FindByName("EquipNum");

            /// <summary>工序编号</summary>
            public static readonly Field TechnicsProcessCode = FindByName("TechnicsProcessCode");

            /// <summary>工单号</summary>
            public static readonly Field WorkOrderNumber = FindByName("WorkOrderNumber");

            /// <summary>产线编号</summary>
            public static readonly Field ProductionLineNo = FindByName("ProductionLineNo");

            /// <summary>生产类型</summary>
            public static readonly Field ProductType = FindByName("ProductType");

            /// <summary>前扫码时间</summary>
            public static readonly Field TimeScanCodeBefore = FindByName("TimeScanCodeBefore");

            /// <summary>短路测试时间</summary>
            public static readonly Field TimeElectrodes = FindByName("TimeElectrodes");

            /// <summary>短路测试耗时时间</summary>
            public static readonly Field ElapsedTimeElectrodes = FindByName("ElapsedTimeElectrodes");

            /// <summary>测高时间</summary>
            public static readonly Field TimeAltimetry = FindByName("TimeAltimetry");

            /// <summary>CDD测试时间</summary>
            public static readonly Field TimeCCD = FindByName("TimeCCD");

            /// <summary>测高高度值</summary>
            public static readonly Field AltimetryValue = FindByName("AltimetryValue");

            /// <summary>前扫码位置</summary>
            public static readonly Field LocationScanCodeBefore = FindByName("LocationScanCodeBefore");

            /// <summary>短路测试仪位置</summary>
            public static readonly Field LocationShortCircuitTester = FindByName("LocationShortCircuitTester");

            /// <summary>电压测试值(V)</summary>
            public static readonly Field VoltageTestValue = FindByName("VoltageTestValue");

            /// <summary>电阻测试值(MΩ)</summary>
            public static readonly Field ResistanceTestValue = FindByName("ResistanceTestValue");

            /// <summary>电流测试值(UA)</summary>
            public static readonly Field CurrentTestValue = FindByName("CurrentTestValue");

            /// <summary>前扫码结果</summary>
            public static readonly Field ResultScanCodeBefore = FindByName("ResultScanCodeBefore");

            /// <summary>CCD1结果</summary>
            public static readonly Field ResultCCD1 = FindByName("ResultCCD1");

            /// <summary>CCD2结果</summary>
            public static readonly Field ResultCCD2 = FindByName("ResultCCD2");

            /// <summary>测高结果</summary>
            public static readonly Field AltimetryResult = FindByName("AltimetryResult");

            /// <summary>短路总结果</summary>
            public static readonly Field ResultShortCicute = FindByName("ResultShortCicute");

            /// <summary>总结果</summary>
            public static readonly Field ResultTotal = FindByName("ResultTotal");

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得生产数据字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary>雪花ID</summary>
            public const String SnowflakeId = "SnowflakeId";

            /// <summary>电池条码</summary>
            public const String BarCode = "BarCode";

            /// <summary>设备编号</summary>
            public const String EquipNum = "EquipNum";

            /// <summary>工序编号</summary>
            public const String TechnicsProcessCode = "TechnicsProcessCode";

            /// <summary>工单号</summary>
            public const String WorkOrderNumber = "WorkOrderNumber";

            /// <summary>产线编号</summary>
            public const String ProductionLineNo = "ProductionLineNo";

            /// <summary>生产类型</summary>
            public const String ProductType = "ProductType";

            /// <summary>前扫码时间</summary>
            public const String TimeScanCodeBefore = "TimeScanCodeBefore";

            /// <summary>短路测试时间</summary>
            public const String TimeElectrodes = "TimeElectrodes";

            /// <summary>短路测试耗时时间</summary>
            public const String ElapsedTimeElectrodes = "ElapsedTimeElectrodes";

            /// <summary>测高时间</summary>
            public const String TimeAltimetry = "TimeAltimetry";

            /// <summary>CDD测试时间</summary>
            public const String TimeCCD = "TimeCCD";

            /// <summary>测高高度值</summary>
            public const String AltimetryValue = "AltimetryValue";

            /// <summary>前扫码位置</summary>
            public const String LocationScanCodeBefore = "LocationScanCodeBefore";

            /// <summary>短路测试仪位置</summary>
            public const String LocationShortCircuitTester = "LocationShortCircuitTester";

            /// <summary>电压测试值(V)</summary>
            public const String VoltageTestValue = "VoltageTestValue";

            /// <summary>电阻测试值(MΩ)</summary>
            public const String ResistanceTestValue = "ResistanceTestValue";

            /// <summary>电流测试值(UA)</summary>
            public const String CurrentTestValue = "CurrentTestValue";

            /// <summary>前扫码结果</summary>
            public const String ResultScanCodeBefore = "ResultScanCodeBefore";

            /// <summary>CCD1结果</summary>
            public const String ResultCCD1 = "ResultCCD1";

            /// <summary>CCD2结果</summary>
            public const String ResultCCD2 = "ResultCCD2";

            /// <summary>测高结果</summary>
            public const String AltimetryResult = "AltimetryResult";

            /// <summary>短路总结果</summary>
            public const String ResultShortCicute = "ResultShortCicute";

            /// <summary>总结果</summary>
            public const String ResultTotal = "ResultTotal";
        }
        #endregion
    }
}